package com.open.cloud.rbac.entity.user;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 登录日志表
 * </p>
 *
 * @author wangzengzhou01
 * @since 2024-12-23
 */

@Data
@ApiModel(value = "CoreUserLoginLog对象", description = "登录日志表")
@TableName("core_user_login_log")
public class CoreUserLoginLog extends Model<CoreUserLoginLog> {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "编号")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    @ApiModelProperty(value = "用户id")
    @TableField("user_id")
    private String userId;

    @ApiModelProperty(value = "操作系统")
    @TableField("os_name")
    private String osName;

    @ApiModelProperty(value = "设备名")
    @TableField("device")
    private String device;

    @ApiModelProperty(value = "浏览器类型")
    @TableField("browser_type")
    private String browserType;

    @ApiModelProperty(value = "ip地址")
    @TableField("ip_address")
    private String ipAddress;

    @ApiModelProperty(value = "登录时间")
    @TableField("create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    @ApiModelProperty(value = "登录结果信息")
    @TableField("result_info")
    private String resultInfo;


    @Override
    public Serializable pkVal() {
        return this.id;
    }

}
